﻿#ifndef INVENTORYMODEL_H
#define INVENTORYMODEL_H
#include"XQDatabaseData.h"
//库存
class InventoryModel :public XQDatabaseData
{
public:
	InventoryModel();
	InventoryModel(const QVariantMap& data, bool base64 = false);
	~InventoryModel();
public:
	QStringList fields()const override;
	QVariantMap toMap(const QStringList& fields, bool base64 = false)const override;
	void setData(const QVariantMap& data, bool base64 = false)override;
	QString createTableSql(const QString& tableName)const override;
public:
	quint64 inventory_id()const;
	QString name()const;
	QString type()const;
	//当前库存
	quint64 currentInventory()const;
	//安全库存
	quint64 safetyInventory()const;
	//补货量
	quint64 restockingQuantity()const;
	QDateTime ctime()const;
	QDateTime mtime()const;
public:
	void setInventory_id(quint64 id);
	void setName(const QString& name);
	void setType(const QString& type);
	void setCurrentInventory(quint64 currentInventory);
	void setSafetyInventory(quint64 safetyInventory);
	void setRestockingQuantity(quint64 restockingQuantity);
	//设置创建时间
	void setCTime(const QDateTime& time = QDateTime::currentDateTime());
	//设置修改时间
	void setMTime(const QDateTime& time = QDateTime::currentDateTime());
protected:
	quint64 m_id=0;//编号
	QString m_name;//名称
	QString m_type;//类型
	quint64 m_currentInventory = 0;//当前库存
	quint64 m_safetyInventory = 0;//安全库存
	quint64 m_restockingQuantity = 0;//补货量
	QDateTime m_mtime = QDateTime::currentDateTime();//修改时间
	QDateTime m_ctime = QDateTime::currentDateTime();//创建时间
};
#endif // !InventoryModel